package com.cloud.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.domain.BaseEntity;
import com.cloud.domain.LoginUser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 用户第三方授权
 *
 * @author yzj
 * @since 2022-05-09
 */
@Data
@Schema(name = "SysUserAuth对象", description = "授权管理")
@TableName("sys_user_auth")
public class SysUserAuth extends BaseEntity {

    @Schema(description = "主键")
    @TableId(value = "auth_id", type = IdType.AUTO)
    private Long authId;

    @Schema(description = "系统编号")
    private String sysCode;

    @Schema(description = "用户主键")
    private Long userId;

    @Schema(description = "授权类型(0内部系统 1钉钉 2浙政钉 3浙里办 4微信)")
    @Excel(name = "授权类型", width = 15, replace = {"系统_0", "钉钉_1", "浙政钉_2", "浙里办_3", "微信_4"})
    private Integer authType;

    @Schema(description = "授权唯一编码")
    @Excel(name = "授权编码", width = 15)
    private String authCode;

    @Schema(description = "授权账户ID")
    @Excel(name = "授权账户ID", width = 15)
    private String accountId;

    @Schema(description = "授权状态（0启用 1禁用）")
    private Integer authState;

    @Schema(description = "账户昵称")
    @TableField(exist = false)
    private String nickName;

    @Schema(description = "授权账户信息")
    @TableField(exist = false)
    private LoginUser loginUser;

}
